#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int gcd(int x, int y)
{
	if (x > y)
	{
		int t = x;
		x = y;
		y = t;

	}
	for (int i = x; i >= 1; i--)
	{
		if (x % i == 0 && y % i == 0)
		{
			return i;
		}
	}
}

struct rational
{
	int fz;
	int fm;
};

int main()
{
	struct rational r1, r2, r3;
	scanf("%d/%d %d/%d", &r1.fz, &r1.fm, &r2.fz, &r2.fm);
	r3.fz = r1.fz * r2.fm + r2.fz * r1.fm;
		r3.fm = r1.fm * r2.fm;
		int max = gcd(r3.fz, r3.fm);
		r3.fz = r3.fz / max;
		r3.fm = r3.fm / max;
		if (r3.fz % r3.fm == 0)
		{
			printf("%d", r3.fz / r3.fm);
		}
		else
		{
			printf("%d/%d", r3.fz, r3.fm);
		}
		return 0;
}